package com.heima.manager.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.heima.manager.service.UserService;
import com.heima.pojo.User;


@RestController
public class UserController {

	@Autowired
	private UserService userService;
	
	@RequestMapping("/user/{id}")
	public User getUserById(@PathVariable Integer id){
		
		User user = userService.getUserById(id);
				
		return user;
		
	}	
}
